import {ajaxJsonp} from '@/utils/index'

const datavMode = (request) => {
  return {
    timebank_volunteerNum(query={}) {
      return request(
        `https://mzj.nanjing.gov.cn/nxyl/sjyh/api/timebank/jd_data/volunteerNum`,
        {
          method: "get",
          params: query,
        }
      );
    },
    // 文件预览下载
    previewFileDowload(fileName, onUploadProgress) {
      return request(`/admin/obs/download/${fileName}`, {
        method: "get",
        responseType: "blob",
        onUploadProgress,
      });
    },
    // 机构list
    largeScreen_orgList(query = {}) {
      return request(`/bussiness/largeScreen/orgList`, {
        method: "post",
        data: query,
      });
    },
    // 设施list
    dpServiceFacilityList(query = {}) {
      return request(`/bussiness/largeScreen/dpServiceFacilityList`, {
        method: "post",
        data: query,
      });
    },
    // 政府购买工单
    govOrderList(query = {}) {
      return request(`/management/tblOrder/noAuthList`, {
        method: "post",
        data: query,
      });
    },
    // 日巡查
    ddzx_dayInspection(query = {}) {
      return request(`/nxjudge/ningxiang/ddzx/dayInspection`, {
        headers:{
          "Content-Type":"application/x-www-form-urlencoded"
        },
        method: "post",
        data: query,
      });
    },
    // 月巡查
    ddzx_monthInspection(query = {}) {
      return request(`/nxjudge/ningxiang/ddzx/monthInspection`, {
        headers:{
          "Content-Type":"application/x-www-form-urlencoded"
        },
        method: "post",
        data: query,
      });
    },
  };
};
// 5.1 系统
const datavMode5_1 = (request) => {
  return {
    // 服务工单
    gl_orderservice(query = {}) {
      return request(
        `https://zhyl.gulou.njapld.com:8081/search/govbuy/orderservice/getLimitstatistics`,
        {
          method: "get",
          params: {
            belongProject: "govBuyManage",
            ...query,
          },
        }
      );
    },
    // 服务工单
    lh_orderservice(query = {}) {
      return request(
        `https://zhyl.gulou.njapld.com:8081/search/govbuy/orderservice/lhOrderLimit`,
        {
          method: "get",
          params: {
            belongProject: "govBuyManage",
            ...query,
          },
        }
      );
    },
    // 六合回访工单
    lh_visitLimit(query = {}) {
      return request(
        `https://zhyl.gulou.njapld.com:8081/search/govbuy/orderservice/lhVisitLimit`,
        {
          method: "get",
          params: {
            belongProject: "govBuyManage",
            ...query,
          },
        }
      );
    },
  };
};

export default ({ request }: any) => ({
  ...datavMode(request),
  ...datavMode5_1(request),
});
